package com.ple.app.sevlet;

import android.content.Context;
import android.net.ConnectivityManager;

/**
 * Created by cov_neeg on 2016/12/29.
 */

public class NetConnect {
    /**
     * 判断是否网络链接
     * @param context
     * @return
     */
    public static boolean isNetworkAvailable(Context context){
        ConnectivityManager manager= (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);

        if(manager.getActiveNetworkInfo()!=null){return manager.getActiveNetworkInfo().isAvailable();}
        else {return false;}
    }
}
